package com.example.framework;

import static org.junit.Assert.fail;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class WebDriverHelper {
	
	protected static WebDriver driver;
	protected StringBuffer verificationErrors = new StringBuffer();

	public String baseUrl = "http://192.168.1.105/addressbook/";
	
	
	
	public WebDriverHelper(){
		driver = new FirefoxDriver();
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
		//manager.getNavigationHelper().openMainPage();
		driver.get(baseUrl);
	}



	

	
	
	public void stop() {
		driver.quit();
		String verificationErrorString = verificationErrors.toString();
		if (!"".equals(verificationErrorString)) {
			fail(verificationErrorString);
		}		
	}

	public WebDriver getDriver() {
		return driver;
	}
	
	

}
